Learn R Programming

outbreaker (version 1.1-6)

reproduction numbers: Derive reproduction numbers from outbreak's outputs

Description

These functions are used to compute reproduction numbers and derive incidence curves from outbreaker's ouptput (functions outbreaker and outbreaker.parallel). They all rely on the entire outbreak having been sampled.
  • get.Rderive distributions of individual effective reproduction numbers.
  • get.Rtderives effective reproduction numbers averaged for each time step.
  • get.incidderives incidence curves for each time step.

Usage

get.Rt(x, burnin=2e4, plot=TRUE, type=c("boxplot", "lines"), lines=FALSE,
       fill.col="gold", lines.col=transp("grey"), ...)

get.R(x, burnin=2e4, ...)

get.incid(x, burnin=2e4, plot=TRUE, type=c("boxplot", "lines"), lines=FALSE, fill.col="gold", lines.col=transp("grey"), ...)

Arguments

x
the output of outbreaker or outbreaker.parallel.
burnin
an integer indicating the number of steps of the MCMC to be discarded as burnin period. Defaults to 20,000.
plot
a logical indicating whether a plot should be displayed.
type
a character indicating the type of plot to be used.
lines
a logical indicating whether individual lines should be added to the plot.
fill.col
the color to be used for the boxplot.
lines.col
the color to be used to the lines.
...
further arguments to be passed to other functions.

Value

  • These functions return a data.frame containing the plotted information.

Examples

Run this code
## load data
data(fakeOutbreak)
attach(fakeOutbreak)

## individual R
barplot(table(get.R(res)), main="Individual effective reproduction numbers")

## R(t)
get.Rt(res)

## incidence
get.incid(res)

detach(fakeOutbreak)

Run the code above in your browser using DataLab